package com.biscuit.page.basicservice.remote.api;

import com.biscuit.common.base.BaseModelResponse;
import com.biscuit.common.base.BaseResponse;
import com.biscuit.common.base.BaseResponseVoid;
import com.biscuit.page.basicservice.api.IAiChatRemote;
import com.biscuit.page.basicservice.api.model.request.ai_chat.AiChatAbortDialogueAReq;
import com.biscuit.page.basicservice.api.model.request.ai_chat.AiChatBuildDialogueResultAReq;
import com.biscuit.page.basicservice.api.model.request.ai_chat.AiChatInitiateChatDialogueAReq;
import com.biscuit.page.basicservice.api.model.response.ai_chat.AiChatBuildDialogueResultAResp;
import com.biscuit.page.basicservice.service.AiChatService;
import com.biscuit.page.basicservice.utils.BaseResponseUtil;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author biscuit
 * @create 2024年07月31日 19:48
 */
@RestController
public class AiChatRemoteImpl implements IAiChatRemote {

    @Resource
    private AiChatService service;

    @Override
    public BaseResponse<BaseModelResponse<String>> newChatSession() {
        return BaseResponseUtil.success(new BaseModelResponse<String>(this.service.execNewChatSession()));
    }

    @Override
    public BaseResponse<BaseModelResponse<String>> initiateChatDialogue(AiChatInitiateChatDialogueAReq req) {
        return BaseResponseUtil.success(new BaseModelResponse<String>(this.service.execInitiateChatDialogue(req)));
    }

    @Override
    public BaseResponse<BaseResponseVoid> buildDialogueResult(AiChatBuildDialogueResultAReq req) {
        this.service.execBuildDialogueResult(req);
        return BaseResponseUtil.success();
    }

    @Override
    public BaseResponse<BaseResponseVoid> rebuildDialogueResult(Long dialogueId) {
        this.service.execRebuildDialogueResult(dialogueId);
        return BaseResponseUtil.success();
    }

    @Override
    public BaseResponse<BaseResponseVoid> abortDialogue(AiChatAbortDialogueAReq req) {
        this.service.execAbortDialogue(req);
        return BaseResponseUtil.success();
    }

}
